﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.OleDb;
using System.Data;
/// <summary>
/// Summary description for Ketnoi
/// </summary>
public static class Ketnoi
{
    static  string sCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|BANHANG.mdb";
    static OleDbConnection con;

    public static OleDbConnection Connect
    {
        get { return Ketnoi.con; }
        set { Ketnoi.con = value; }
    }

    static Ketnoi()
	{
        con = new OleDbConnection(sCon);
	}
    public static void Open()
    {
        if (con.State != ConnectionState.Open)
        {
            con.Open();
        }
    }
    public static void Close()
    {
        if (con.State == ConnectionState.Open)
        {
            con.Close();
        }
    }
}